Skip to main content

Console

Console can be used for logs and monitoring the state of broker with HTTP requests. On getting the request, broker prints the information to the terminal.

see configuration for configuration details

Available endpoints in console:

RequestEndpointDescription
GET/Returns configuration of console
GET/configPrint router configuration
GET/routerPrint router meter
GET/device/:device_idPrint events and tracker for requested device
GET/subscriptionsPrints all subscription filters and subscribed clients to the filter
GET/subscriptions/:filterPrint subscription meter for a particular filter
GET/waiters/:filterPrint the clients and datarequest present in waiters
GET/readyqueuePrint the readyqueue
POST/logsTo update log levels and tracing filter

Dynamically updating log filters

Log levels and filters can by dynamically updated without restarting broker.

To update the filter, we can send a POST request to /logs endpoint, which is exposed by our console, with new filter as plain-text in body.

For example, to get logs of rumqttd ( running locally and expose console at port 3030 , see Configuration for configuring console ) with log level "debug", we can do:

curl -d "rumqttd=debug" 0.0.0.0:3030/logs

The general syntax for filter is:

target[span{field=value}]=level

So filter for logs of client with id "pub-001" which has occurred any any span will be [{client_id=pub-001}]. Know more about it here